/*
 * 易族智汇（北京）科技有限公司 版权所有。
 * 未经许可，您不得使用此文件。
 * 官方地址：www.javamall.com.cn
 */
package com.enation.app.javashop.core.client.feignimpl.member;

import com.enation.app.javashop.client.member.MemberCouponClient;
import com.enation.app.javashop.core.client.fallback.member.MemberCouponClientFallbackFactory;
import com.enation.app.javashop.core.handler.FeignConfiguration;
import com.enation.app.javashop.model.member.dos.MemberCoupon;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 优惠券Feign实现
 *
 * @author kingapex
 * @version 1.0
 * @since 7.0.0
 * 2018/7/6
 */
@FeignClient(name = "member-service", fallbackFactory = MemberCouponClientFallbackFactory.class,configuration = {FeignConfiguration.class})
public interface MemberCouponClientFeigntImpl extends MemberCouponClient {

    @Override
    @RequestMapping(value = "/client/members/coupons", method = RequestMethod.GET)
    List<MemberCoupon> listByCheckout(@RequestParam("seller_ids") Long[] sellerIds, @RequestParam("member_id") Long memberId);


    @Override
    @RequestMapping(value = "/client/members/coupons/{mc_id}", method = RequestMethod.GET)
    MemberCoupon getModel(@RequestParam("member_id") Long memberId, @PathVariable("mc_id") Long mcId);

    /**
     *  更新优惠券的店铺名称
     * @param sellerId
     * @param sellerName
     */
    @Override
    @RequestMapping(value = "/client/members/coupons/update-seller-name", method = RequestMethod.POST)
    void updateSellerName(@RequestParam("seller_id") Long sellerId,@RequestParam("seller_name")String sellerName);
}
